﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace oopPrijectDraft
{
    public class DesktopComputer:Merchandise
    {
        public DesktopComputer(string description, string manufacturer, double price, uint year, uint quantity,double cpu,double ram,double hdd)
            : base(description, manufacturer, price, year, quantity)
        {
            Cpu = cpu;
            Ram = ram;
            Hdd = hdd;
        }

        private double cpu;

        public double Cpu
        {
            get { return cpu; }
            set { cpu = value; }
        }

        private double ram;

        public double Ram
        {
            get { return ram; }
            set { ram = value; }
        }

        private double hdd;

        public double Hdd
        {
            get { return hdd; }
            set { hdd = value; }
        }


        public override void Display()
        {
            throw new NotImplementedException();
        }
        public override string ToString()
        {
            return base.ToString();
        }
        public override void Encode(StreamWriter writer)
        {
            int lineCount = 0;
            
            foreach (char symbol in Description )
            {
                if (symbol=='\n')
                {
                    lineCount++;
                }
                lineCount++;
            }
            
            writer.WriteLine(lineCount);
            writer.WriteLine(Description);
            writer.WriteLine(Manufacturer);
            writer.WriteLine(Price);
            writer.WriteLine(Year);
            writer.WriteLine(Quantity);
            writer.WriteLine(cpu);
            writer.WriteLine(ram);
            writer.WriteLine(hdd);

        }
    }
}
